#ifndef _THREAD_MEMORY_POOL_HPP_20120428
#define _THREAD_MEMORY_POOL_HPP_20120428

#include "base.hpp"
#include "condition.hpp"
#include "lock.hpp"
#include "memory_pool.hpp"

namespace mina
{
	class ThreadMemoryPool : public MemoryPool
	{
		public :
			ThreadMemoryPool(int block_size, int block_num)
				: MemoryPool(block_size, block_num)
			{
			}

			virtual ~ThreadMemoryPool() {}

			virtual void * allocate();
			virtual void deallocate(void * addr);

		public :
			thread::Condition   _cond;
			thread::Lock        _lock;
	};

}

#endif

